var scrollTop = 0;
    var backTopFlag = false;
    let totpdiv = document.getElementsByClassName("totop")[0]
    const scrollToTop = () => {
        scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
        // 为了计算距离顶部的高度，当高度大于60显示回顶部图标，小于60则隐藏
        backTopFlag = scrollTop > 200;

        backTopFlag ? totpdiv.setAttribute("style", "display:block;") : totpdiv.setAttribute("style", "display:none;");

    };

    window.addEventListener('scroll', scrollToTop);

   
    // $("#div1").load('./pages/home/home.html');
    // fetch('./pages/home/home.html')
    //     .then(response => response.text())
    //     .then(htmlContent => {
    //         // 获取页面内容后，将其插入到容器中
    //         document.getElementById('div1').innerHTML = htmlContent;
    //     })
    //     .catch(error => {
    //         console.error('Error fetching new page:', error);
    //     });
    // document.getElementById("div1").innerHTML = home.import.body.innerHTML;
    // document.getElementById("div1").innerHTML = '<object type="text/html" data="./pages/home/home.html" width="100%" height="100%"></object>';
    // document.getElementById("div2").innerHTML = my.import.body.innerHTML;
    // document.getElementById("div2").innerHTML = '<object type="text/html" data="./pages/my/my.html" width="100%" height="100%"></object>';